package com.ethink.order.facadeImpl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ethink.order.api.TobSaleReturnOrderFacade;
import com.ethink.order.api.info.TobSaleReturnDetailOrderInfo;
import com.ethink.order.api.info.TobSaleReturnOrderInfo;
import com.ethink.order.api.model.TobSaleReturnModeModel;
import com.ethink.order.api.model.TobSaleReturnModel;
import com.ethink.order.api.request.TobSaleReturnOrderAddRequest;
import com.ethink.order.api.request.TobSaleReturnOrderQueryRequest;
import com.ethink.order.api.request.TobSaleReturnOrderTakePlaceInsertQueryRequest;
import com.ethink.order.api.request.TobSaleReturnOrderUpdateRequest;
import com.ethink.order.api.response.TobSaleReturnQueryDetailResponse;
import com.ethink.order.service.TobSaleReturnDetailOrderService;
import com.ethink.order.service.TobSaleReturnOrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 预售退单 Facade接口实现
 *
 * @author default
 * @date 2022-12-08
 */
@RestController
@Slf4j
@RequestMapping("order-service/facade/v1/tobSaleReturnOrder")
public class TobSaleReturnOrderFacadeImpl implements TobSaleReturnOrderFacade {

    @Autowired
    private TobSaleReturnOrderService tobSaleReturnOrderService;

    @Autowired
    private TobSaleReturnDetailOrderService tobSaleReturnDetailOrderService;

    @Override
    public Boolean add(TobSaleReturnOrderAddRequest request) {
        return tobSaleReturnOrderService.add(request);
    }

    @Override
    public Page<TobSaleReturnModel> pageQuery(TobSaleReturnOrderQueryRequest request) {
        return tobSaleReturnOrderService.pageQuery(request);
    }

    @Override
    public TobSaleReturnQueryDetailResponse queryDetail(Long id) {
        return tobSaleReturnOrderService.queryDetail(id);
    }

    @Override
    public Boolean update(TobSaleReturnOrderUpdateRequest request) {
        return tobSaleReturnOrderService.update(request);
    }

    @Override
    public Boolean delete(Long id) {
        return tobSaleReturnOrderService.delete(id);
    }

    @Override
    public Boolean pass(Long id) {
        return tobSaleReturnOrderService.pass(id);
    }

    @Override
    public Boolean refuse(Long id) {
        return tobSaleReturnOrderService.refuse(id);
    }

    @Override
    public List<TobSaleReturnDetailOrderInfo> queryDetailListByTobSaleOrderNo(String tobSaleOrderNo) {
        return tobSaleReturnDetailOrderService.queryDetailListByTobSaleOrderNo(tobSaleOrderNo);
    }

    @Override
    public List<String> queryTobSaleReturnOrderDetailOrderNosByOrderNos(List<String> orderNos) {
        return tobSaleReturnDetailOrderService.queryTobSaleReturnOrderDetailOrderNos(orderNos);
    }

    @Override
    public Boolean tobSaleReturnOrderTakePlaceInsert(TobSaleReturnOrderTakePlaceInsertQueryRequest request) {
        return tobSaleReturnOrderService.tobSaleReturnOrderTakePlaceInsert(request);
    }

    @Override
    public TobSaleReturnOrderInfo selectById(Long id) {
        return tobSaleReturnOrderService.selectById(id);
    }

    @Override
    public Boolean tobSaleReturnOrderRevokeOrder(Long id) {
        return tobSaleReturnOrderService.tobSaleReturnOrderRevokeOrder(id);
    }

    @Override
    public Page<TobSaleReturnModeModel> pageModeQuery(TobSaleReturnOrderQueryRequest request) {
        return tobSaleReturnOrderService.pageModeQuery(request);
    }
}